package com.quxiu.system.api;

import com.quxiu.common.core.constant.SecurityConstants;
import com.quxiu.common.core.constant.ServiceNameConstants;
import com.quxiu.common.core.domain.R;
import com.quxiu.system.api.factory.RemoteIdFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 用户服务
 *
 * @author quxiu
 */
@FeignClient(contextId = "remoteIdService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteIdFallbackFactory.class)
public interface RemoteIdService {
    /**
     * 获取下一个id
     *
     * @param source   请求来源
     * @return 结果
     */
    @GetMapping("/id/nextId")
    R<Long> nextId(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
